package com.hsgene.goods.dto;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.hsgene.common.util.date.TimeJsonDeserializer;
import com.hsgene.goods.domain.GoodsMall;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @author wangbing
 * @version 1.0, 2018/7/14
 */
public class SimpleGoodsDto implements Serializable {

    private static final long serialVersionUID = -4897873994675451609L;
    /**
     * 商城商品编号
     */
    private String mallGoodsId;

    /**
     * 商品编号
     */
    private String goodsId;

    /**
     * 主分类
     */
    private Integer mainCategory;

    /**
     * 子分类
     */
    private Integer subCategory;

    /**
     * 供应商名称
     */
    private String supplierName;

    /**
     * 套餐名称
     */
    private String goodsName;

    /**
     * 封面图
     */
    private String coverUrl;

    /**
     * 市场价
     */
    private BigDecimal marketPrice;

    /**
     * 价格区间开始
     */
    private BigDecimal priceSectionStart;

    /**
     * 价格区间结束
     */
    private BigDecimal priceSectionEnd;

    /**
     * 状态：待完善、待发布、已发布、修改申请中、上架中、已下架
     */
    private Integer status;

    /**
     * 更新时间
     */
    @JsonDeserialize(using = TimeJsonDeserializer.class)
    private Date updateTime;

    /**
     * 销量
     */
    private Integer salesVolume;

    /**
     * 评论量
     */
    private Integer commentVolume;

    /**
     * 是否收藏该商品
     */
    private boolean collected = false;

    public SimpleGoodsDto() {
    }

    public SimpleGoodsDto(GoodsMall mall) {
        BeanUtils.copyProperties(mall, this);
        this.mallGoodsId = mall.getId();
        this.commentVolume = mall.getGoodCommentVolume();
    }

    public String getMallGoodsId() {
        return mallGoodsId;
    }

    public void setMallGoodsId(String mallGoodsId) {
        this.mallGoodsId = mallGoodsId;
    }

    public String getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(String goodsId) {
        this.goodsId = goodsId;
    }

    public Integer getMainCategory() {
        return mainCategory;
    }

    public void setMainCategory(Integer mainCategory) {
        this.mainCategory = mainCategory;
    }

    public Integer getSubCategory() {
        return subCategory;
    }

    public void setSubCategory(Integer subCategory) {
        this.subCategory = subCategory;
    }

    public String getSupplierName() {
        return supplierName;
    }

    public void setSupplierName(String supplierName) {
        this.supplierName = supplierName;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public String getCoverUrl() {
        return coverUrl;
    }

    public void setCoverUrl(String coverUrl) {
        this.coverUrl = coverUrl;
    }

    public BigDecimal getPriceSectionStart() {
        return priceSectionStart;
    }

    public void setPriceSectionStart(BigDecimal priceSectionStart) {
        this.priceSectionStart = priceSectionStart;
    }

    public BigDecimal getPriceSectionEnd() {
        return priceSectionEnd;
    }

    public void setPriceSectionEnd(BigDecimal priceSectionEnd) {
        this.priceSectionEnd = priceSectionEnd;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getSalesVolume() {
        return salesVolume;
    }

    public void setSalesVolume(Integer salesVolume) {
        this.salesVolume = salesVolume;
    }

    public Integer getCommentVolume() {
        return commentVolume;
    }

    public void setCommentVolume(Integer commentVolume) {
        this.commentVolume = commentVolume;
    }

    public BigDecimal getMarketPrice() {
        return marketPrice;
    }

    public void setMarketPrice(BigDecimal marketPrice) {
        this.marketPrice = marketPrice;
    }

    public boolean getCollected() {
        return collected;
    }

    public void setCollected(boolean collected) {
        this.collected = collected;
    }
}
